﻿@model YanForum.Engine.ViewModels.PasswordModel

@{
    ViewBag.Title = "Thay đổi mật khẩu - Tài khoản: " + Model.UserName;
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

@using (Html.BeginForm("SetPassWord", "AccountAdmin", new { area = "Admin" }, FormMethod.Post, new { @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()
    @Html.ValidationSummary()

    if (ViewBag.Success != null)
    {
        <div class="form-group">
            <div class="alert alert-info">
                @ViewBag.Success
            </div>
        </div>
    }
    <div class="form-group">
        @Html.LabelFor(m => m.RoleId, new { @class = "col-sm-3" })
        <div class="col-sm-4">
            @Html.DropDownListFor(m => m.RoleId, YanForum.Engine.Services.Account.GetListRole().Select(r => new SelectListItem
            {
                Selected = Model.RoleId == r.RoleId,
                Text = r.RoleName,
                Value = r.RoleId.ToString()
            }), new { @class = "form-control" })
        </div>
    </div>
    
    <div class="form-group">
        @Html.LabelFor(m => m.NewPassword, new { @class = "col-sm-3" })
        <div class="col-sm-4">
            @Html.PasswordFor(m => m.NewPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.NewPassword)
            @Html.HiddenFor(r=>r.UserId)
            @Html.HiddenFor(r=>r.UserName)
        </div>
    </div>
    
    <div class="form-group">
        @Html.LabelFor(m => m.ConfirmPassword, new { @class = "col-sm-3" })
        <div class="col-sm-4">
            @Html.PasswordFor(m => m.ConfirmPassword, new { @class = "form-control" })
            @Html.ValidationMessageFor(m => m.ConfirmPassword)
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-3">&nbsp;</div>
        <div class="col-sm-6">
            <button type="submit" class="btn btn-default">Cập nhật</button>
        </div>
    </div>
}
@section Scripts {
    @Scripts.Render("~/bundles/jqueryval")
}
